package com.my.code.algorithm;

import java.util.LinkedList;
import java.util.Queue;

/**
 * <b></b><p>
 *
 * @author zzl
 * @date 2020/10/23
 */
public class TestLinkedList {

    public static void main(String[] args) {
        Queue<Integer> queue = new LinkedList<>();
        queue.offer(1);

        for (Integer i : queue) {
            queue.add(2+i);//抛出异常
        }

        System.out.println("queue = " + queue);
    }

}
